package sg.edu.nus.iss.cerberus.model;

import java.util.ArrayList;
import java.util.StringTokenizer;

import sg.edu.nus.iss.cerberus.engine.JUnitMethodCheck;

public class MethodTestData {

	private String name;
	private String expected;
	private ArrayList<String> param;
	private JUnitMethodCheck assertCheck;
	private String Signature;
	
	public MethodTestData() {
		super();
		assertCheck= new JUnitMethodCheck();
		param= new ArrayList<String>();
	}

	public ArrayList<String> getSignature() {
		ArrayList<String> temp=new ArrayList<String>();
		StringTokenizer token=new StringTokenizer(Signature,"(");
		while(token.hasMoreElements()){
			token.nextToken();
			StringTokenizer token1=new StringTokenizer(token.nextToken(),")");
			while(token1.hasMoreElements()){
				StringTokenizer token2=new StringTokenizer(token1.nextToken(),",");
				while(token2.hasMoreElements()){
					temp.add(token2.nextToken());
				}
				}
			}
		return temp;
	}

	public void setSignature(String signature) {
		Signature = signature;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getExpected() {
		return expected;
	}
	public void setExpected(String expected) {
		this.expected = expected;
	}
	public ArrayList<String> getParam() {
		return param;
	}
	public void setParam(ArrayList<String> param) {
		this.param = param;
	}
	public JUnitMethodCheck getAssertCheck() {
		return assertCheck;
	}
	public void setAssertCheck(JUnitMethodCheck assertCheck) {
		this.assertCheck = assertCheck;
	}
	
	public boolean isAssertExist(String assertName)	{
		return assertCheck.isAssertExists(assertName);
	}
	
}
